package com.jxb.service;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanNameAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

//@Component
public class IgnoreDependencyTest implements ApplicationContextAware {

    private ApplicationContext applicationContext;

    //这里的set方法会执行2次
    //第一次：属性注入
    //第二次：aware方法回调
//    @Autowired
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        System.out.println("执行此处");
        this.applicationContext = applicationContext;
    }
}
